
const user = {
    state: {
        user: {},
        isAdmin: false
    },

    mutations: {
        SET_USER: (state, user) => {
            state.user = user
        },
        SET_IS_ADMIN: (state, bool) => {
            state.isAdmin = bool
        }
    },

    actions: {
        async setUser({commit}, user) {
            commit('SET_USER', user)
        },
        async setIsAdmin({commit}, bool) {
            commit('SET_IS_ADMIN', bool)
        }
    }
}

export default user
